using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UIManager : MonoBehaviour
{
    public static UIManager Instance;

    public Image HPMask;
    public float originalSize;

    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            originalSize = HPMask.rectTransform.rect.width;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
        

    }

    public void SetHPValue(float fillpercent)
    {
        HPMask.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, fillpercent * originalSize);
    }
}
